import { EntitySchema } from '@mikro-orm/core';

export class LeEvaluate {
  id!: string;
  repositoryId!: string;
  star!: number;
  content!: string;
  images?: string;
  createdTime: number = 0;
  updatedTime: number = 0;
  deletedTime: number = 0;
  isDeleted: boolean = false;
}

export const LeEvaluateSchema = new EntitySchema({
  class: LeEvaluate,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    repositoryId: { type: 'string', columnType: 'bigint', index: 'repository_id' },
    star: { type: 'number' },
    content: { type: 'string', columnType: 'text' },
    images: { type: 'string', columnType: 'text', nullable: true },
    createdTime: { type: 'number', default: 0 },
    updatedTime: { type: 'number', default: 0 },
    deletedTime: { type: 'number', default: 0 },
    isDeleted: { type: 'boolean', default: false },
  },
});
